<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="icon" type="text/css" href="icon.ico"/>
    <link rel="stylesheet" type="text/css" href="/shop/Public/Home/css/index.css" />
    <script src="/shop/Public/Home/js/jquery-1.10.1.min.js" type="text/javascript" charset="utf-8"></script>

    <script src="/shop/Public/Home/js/list.js" type="text/javascript" charset="utf-8"></script>
    <!--<script src="/shop/node_modules/hdjs/app/util.js"></script>-->
    <!--<script src="/shop/node_modules/hdjs/require.js"></script>-->
    <!--<script src="/shop/node_modules/hdjs/config.js"></script>-->
    <script src="/shop/Public/Home/js/layer.js"></script>

</head>

<body>
<!--头部开始-->
<div id="top">
    <!--头部灰条就开始-->
    <div class="topbox">
        <div class="main">
            <div class="topleft fl">
                <a href="javascript:;">欢迎来到<?php echo V("sp_system.0")['svalue'];?></a>
                <a href="#">设为首页</a>
                <a href="#">收藏本站</a>
                <!--<a href="#">帮助中心</a>-->
                <!--<a href="#" class='last'><i></i>手机商城</a>-->
            </div>
            <div class="topright fr">
                <div class="login fl">
                    <?php if(isset($_SESSION['uid'])): ?><span>欢迎您回来 <?php echo $_SESSION['uname']?><a href="<?php echo U('home/userinfo/info');?>">去个人中心</a></span>
                        <span><a href="<?php echo U('home/lg/exitlogin');?>">退出</a></span>
                        <?php else: ?>
                        <a href="<?php echo U('Home/Lg/login');?>">登录</a>
                        <a href="<?php echo U('Home/Lg/regest');?>">注册</a><?php endif; ?>
                </div>
                <span class="fl">|</span>

                <div class="fcode fl">

                    <a href="<?php echo U('home/userinfo/order');?>">我的订单</a>
                </div>
            </div>
        </div>
    </div>
    <!--头部灰条结束-->

    <!--logo区域开始-->
    <div class="logoRegion">
        <div class="main">
            <div class="logo">
                <a href="/shop/dami.html"><img width="185px" height="70px" src="<?php echo V('sp_system.3')['svalue'];?>"/></a>
            </div>
            <div class="seachRegion">
                <div class="seach fl">
                    <form action="<?php echo U('home/search/searchs');?>" method="post">
                        <input type="text" name="gname" class="seachtxt fl" value="O2+车载空气净化"/>
                        <input type="submit" class="btn" value=""/>
                    </form>
                    <p class="searchkey">
                        <?php if(is_array($hot)): $i = 0; $__LIST__ = $hot;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><a href="<?php echo U('home/goodinfo/index',['gid'=>$vo['gid']]);?>" style="display: inline-block;width: 160px;height:20px;overflow: hidden"><?php echo ($vo['gname']); ?></a><?php endforeach; endif; else: echo "" ;endif; ?>
                    </p>
                </div>

                <?php if((CONTROLLER_NAME != 'Order') AND (CONTROLLER_NAME != 'Car')): ?><div class="topshopcart fr">
                        <a href="<?php echo U('home/car/lists');?>" class="header-cart"><i></i>我的购物车<span class="cart-size">(<?php echo ($cars); ?>)</span></a>
                        <div class="cart-tips" style="width: 250px;padding-bottom: 10px">
                            <?php if(isset($_SESSION['uid'])): ?><ul id="car_ul" style="background: #fff;width: 250px;padding: 0px;margin: 0px;padding-bottom: 10px">
                                </ul>
                                <?php else: ?>
                                请
                                <a href="<?php echo U('home/lg/login');?>">登录</a>后查看您的购物车。<?php endif; ?>
                        </div>
                    </div><?php endif; ?>


            </div>
            <script>
                //                购物车AJAX异步
                $('.header-cart').mouseenter(function(){
                    uid="<?php echo session('uid');?>";
                    if(uid){
                        var str='';
                        var count=0;
                        $.post("<?php echo U('home/car/finAjxgood');?>",{uid:uid}, function (res) {
                            if($.isEmptyObject(res)){
//                            alert(444);
                                $('#car_ul').html('购物车中没有一件商品，快去购物吧');return false;
                            }else {
                                console.log(res);
                                $.each(res, function (k, v) {
                                    count = count + parseInt(v.count);
                                    str += '<li style="width: 250px;padding: 0px;margin: 0px;height:50px;line-height:20px;text-align: left;border-bottom: 2px dashed orangered;padding-bottom: 15px;margin-top: 8px">';
                                    str += '<a href="" style="display:block;width: 50px;height:60px;float: left;margin-left: 5px;">';
                                    str += '<img width="50px" height="50px" src="' + v.thumb + '" alt=""></a>';
                                    str += '<a href="" style="display: block;width: 80px;height: 60px;float:left;overflow: hidden;margin-left: 15px">' + v.gname + '</a>';
                                    str += '<a style="display: block;width:90px;height: 60px;float:left;overflow: hidden;margin-left: 5px">￥' + v.priced + ' X ' + v.count + '<br/><br/><span ugid="'+v.ugid+'" class="delgood" style="padding: 4px 4px;background: orange;cursor: pointer">删除</span></a></li>';
                                })
//                        alert(str);
                                str += '<li style="line-height: 20px;padding-top: 10px;;margin: 0px"> <a href="/shop/home/car/lists" style="background: orangered;color:#fff;line-height: 20px;padding: 5px;margin: 0px">去结算</a> </li>';
                                $('.cart-size').html('(' + count + ')');
                                $('#car_ul').html(str);
                            }
                        });
                    }

                })
                //购物车删除按钮删除购物车中的物品
                $('#car_ul').on('click','.delgood',function(){
                    var ugid=$(this).attr('ugid');
                    that=$(this);
                    //异步后台删除
                    $.post("<?php echo U('home/car/ajaxdelgood');?>",{ugid:ugid},function(res){
                        if(res.valid){
                            location.reload();
                        }
                    },'json');
                });

            </script>
        </div>
    </div>
    <!--logo区域结束-->
    <div class="clear"></div>
    <!--导航开始-->
    <div class="navbox">
        <div class="main">
            <h5 class="fl"><a href="<?php echo U('Home/index/index');?>"><i></i>全部智能酷品</a></h5>
            <ul class="menu fl">
                <?php if(is_array($nature)): foreach($nature as $key=>$vo): ?><li class="menulist">
                    <a href=""><?php echo ($vo['nname']); ?></a>
                    <div class="menuHiden">
                        <ul class="product">
                            <?php if(is_array($vo['goods'])): foreach($vo['goods'] as $key=>$voo): ?><li>
                                <a href="<?php echo U('home/goodinfo/index',['gid'=>$voo['gid']]);?>"><img width="150px" height="157px" src="<?php echo ($voo['thumb']); ?>" alt="" /></a>
                            </li><?php endforeach; endif; ?>
                        </ul>
                    </div>
                </li><?php endforeach; endif; ?>

            </ul>

        </div>

    </div>
    <!--导航结束-->
    <div class="clear"></div>

</div>
<!--头部结束-->
<!--中间开始-->

<link rel="stylesheet" type="text/css" href="/shop/Public/Home/css/account.css"/>
<script src="/shop/Public/Home/js/account.js" type="text/javascript" charset="utf-8"></script>
<div class="body-center">
	<div class="center-content">
		<!--头部开始-->
		<div class="content-header">
			<p>收获地址  <span>温馨提示：为了保证您的权益，防止黄牛倒卖，订单进入正在配货状态将不能修改收货地址和发票信息！</span></p>
		</div>
		<!--头部结束-->
		<!--地址选择开始-->
		<div class="content-address">
			<?php if(is_array($addr)): foreach($addr as $key=>$vo): ?><div class="consignee-item">
				<span udid="<?php echo ($vo['udid']); ?>" class="radio-img <?php if($vo['poststatus'] == 1){?> pitchOn <?php }?>"></span>
				<label for="adress1" class="radio">
					<input type="radio" name="adress" id="adress1" class="radio-select" value=""/>
					<span class="e-name"><?php echo ($vo['postname']); ?></span>，
					<span class="city"><?php echo ($vo['useraddr']); ?> </span>，
					<span class="codeNumber"><?php echo ($vo['phone']); ?></span>
				</label>
				<!--<span class="compile"><a class="copyreader" href="javascript:;">编辑</a></span>-->
			</div><?php endforeach; endif; ?>

			<!--添加新地址-->

			<div class="consignee-item new-ress">
				<span class="radio-img"></span>
				<label for="adress3" class="radio"><input type="radio" name="adress" id="adress3" class="radio-select"  value=""/>使用新地址</label>
			</div>
			<!--添加地址框-->
			<div class="add-address new">
				<form action="" onsubmit="return addaddr()" method="post">
					<div class="s-name">
						<h3 class="style"><b>*</b>收货人姓名</h3>
						<input type="text" class="public" name="postname" id="name" placeholder="收货人姓名" value="" />
					</div>
					<div class="address-s">
						<h3 class="style"><b>*</b>地址</h3>

						<!--城市联动-->
						<!--<input type="text" name="name" id="name" placeholder="收货人姓名" value="" />-->
						<textarea name="useraddr" placeholder="路名或街道地址，门牌号 " id="particular" rows="" cols=""></textarea>
					</div>

					<div class="postcode">
						<h3 class="style"><b>&nbsp;</b>邮政编码</h3>
						<input type="text" class="public" name="postcode" id="postcode" placeholder="6位邮政编码" value="" />
					</div>
					<div class="shouji">
						<h3 class="style"><b>*</b>手机号码 </h3>
						<input type="text" class="public" name="phone" id="shouji" placeholder="11位手机号码" value="" />
					</div>
					<div class="btn-group">
						<input type="submit"  class="btn" id="btn-bao" value="保存"/>
						<a href="javascript:;" class="btn-qu btn">取消</a>
					</div>

				</form>
			</div>
			<script>
				 function addaddr(){
					 that=$(this);
					 var data=$('form').serialize();
					 $.post("<?php echo U('home/order/ajaxaddaddr');?>",data,function(res){
                         if(res.valid){
							 $('.add-address').remove();
							 layer.msg('添加成功');
							 location.reload();
						 }else{
							 layer.alert('请你填写'+res.msg, {icon: 6});
						 }
					 });
					 return false;
				 }
			</script>
			<!--添加地址按钮-->
			<a href="javascript:;" class="new-address"></a>
			<!--添加新地址结束-->
			<!--编辑开始-->
			<!--<div class="add-address edit">-->
				<!--<form action="" method="post">-->
					<!--<div class="s-name">-->
						<!--<h3 class="style"><b>*</b>收货人姓名</h3>-->
						<!--<input type="text" class="public" name="name" id="name" placeholder="收货人姓名" value="" />-->
					<!--</div>-->
					<!--<div class="address-s">-->
						<!--<h3 class="style"><b>*</b>地址</h3>-->

						<!--&lt;!&ndash;城市联动&ndash;&gt;-->
						<!--&lt;!&ndash;<input type="text" name="name" id="name" placeholder="收货人姓名" value="" />&ndash;&gt;-->
						<!--<textarea name="particular" placeholder="路名或街道地址，门牌号 " id="particular" rows="" cols=""></textarea>-->
					<!--</div>-->

					<!--<div class="postcode">-->
						<!--<h3 class="style"><b>&nbsp;</b>邮政编码</h3>-->
						<!--<input type="text" class="public" name="postcode" id="postcode" placeholder="6位邮政编码" value="" />-->
					<!--</div>-->
					<!--<div class="shouji">-->
						<!--<h3 class="style"><b>*</b>手机号码 </h3>-->
						<!--<input type="text" class="public" name="shouji" id="shouji" placeholder="11位手机号码" value="" />-->
					<!--</div>-->
					<!--<div class="btn-group">-->
						<!--<input type="submit"  class="btn" id="btn-bao" value="保存"/>-->
						<!--<a href="javascript:;" class="btn-qu btn">取消</a>-->
					<!--</div>-->
				<!--</form>-->
			<!--</div>-->
		</div>
		<!--地址选择结束-->
		<!--选项开始-->
		<div class="options">
			<div class="options-all">
				<div class="payment options-public">
					<h3>支付方式</h3>
				</div>
				<div class="consignee-item new-ress">
					<span class="radio-img pitchOn"></span>
					<label for="payment" class="radio w122"><input type="radio" name="payment" id="payment" class="radio-select"  value=""/>在线支付</label>
				</div>
			</div>
			<div class="options-all">
				<div class="distribution options-public">
					<h3>配送方式</h3>
				</div>
				<div class="consignee-item new-ress">
					<span class="radio-img pitchOn"></span>
					<label for="distribution" class="radio w122"><input type="radio" name="distribution" id="distribution" class="radio-select"  value=""/>免费配送</label>
				</div>
			</div>
			<div class="options-all invoice">
				<form id="fapiao" method="post" action="">
				<div class=" options-public">
					<h3>发票信息</h3>
				</div>
				<div class="box-all" style="overflow: hidden;">
					<div class="consignee-item new-ress left">
						<span class="radio-img pitchOn"></span>
						<label for="invoice" class="radio w122 no">
							<input type="text"  name="voi" id="invoice" class="radio-select "  value="0"/>不开发票</label>
					</div>
					<div class="consignee-item new-ress left">
						<span class="radio-img "></span>
						<label for="invoice1" class="radio w122 yes">
							<input type="text" disabled="disabled" name="voi" id="invoice1" class="radio-select "  value="1"/>普通发票</label>

					</div>
				</div>
				<div class="con">
					<div class="text">发票内容：购买商品明细</div>
					<div class="text">发票抬头：请确认单位名称正确，以免因名称错误耽搁您的报销。</div>
					<div class="box-all" style="overflow: hidden; margin-top: 10px;">
						<a href="javascript:;" class="geren tongyong active">个人</a>
						<a href="javascript:;" class="danwei tongyong">单位</a>
					</div>
					<div class="danweiname" >
						<div class="text">单位名称：</div>
						<input type="text" name="danweiname" id="danweiname" value="" />
					</div>
				</div>
					</form>
			</div>

		</div>
		<!--选项结束-->
		<div class="options-all  goods">
			<div class="qingdan options-public" style="border: none;">
				<h3>商品清单</h3>
			</div>
			<div class="goodsList">
				<div class="title">
					<ul>
						<li class="l1">商品名称</li>
						<li class="l2">单价</li>
						<li class="l3">数量</li>
						<li class="l4">合计</li>
					</ul>
				</div>
			</div>

			<div class="goods-cont">
				<ul>
					<?php if(is_array($zhifu['goods'])): foreach($zhifu['goods'] as $key=>$vo): ?><li style="padding: 13px;">
						<div class="gc1">
							<img src="<?php echo ($vo['thumb']); ?>"/>
							<span><?php echo ($vo['gname']); ?></span>
						</div>
						<div class="gc2">
							¥
							<span><?php echo ($vo['priced']); ?></span>
						</div>
						<div class="gc3">
							X
							<span><?php echo ($vo['count']); ?></span>
						</div>
						<div class="gc4">
							¥
							<span><?php echo ($vo['zongjia']); ?></span>
						</div>
					</li><?php endforeach; endif; ?>
				</ul>
			</div>
			<!--总计-->
			<div class="zongji">
				<ul>
					<li>
						共<span class="color"><?php echo ($zhifu['zongshu']); ?></span>件
					</li>
					<li>
						金额合计：<span><?php echo ($zhifu['jiage']); ?></span>元
					</li>
					<li>
						优惠抵扣：<span>-0.00</span>元
					</li>
					<li>
						配送费：<span>0</span>元
					</li>
					<li style="margin-top: 15px;">
						<h3>应付总金额：<span class="color"><?php echo ($zhifu['jiage']); ?></span>元</h3>
					</li>
				</ul>
			</div>
			<!--确认地址-->
			<div class="mailTo">
				<p>寄送至：<span class="m-city"><?php echo ($moren['useraddr']); ?> </span><span class="m-particular"></span></p>
				<p>(收件人)<span class="m-name"></span>  <span class="m-number"><?php echo ($moren['postname']); ?> <?php echo ($moren['phone']); ?></span> </p>
			</div>
			<div class="" style="overflow: hidden;">
				<a href="javascript:;" onclick="pay()" class="liji">立即下单</a>
			</div>

		</div>


	</div>
</div>
<script>
	function pay(){
//		alert($('.content-address .consignee-item .pitchOn').length);
//		没有选地址时,提示选择地址
	  if($('.content-address .consignee-item .pitchOn').length!=1){
		  layer.msg('请选择收货地址', function(){
		  });
		  return false;
	  }
		//获取用户的收货信息
		var udid=$('.content-address .consignee-item .pitchOn').attr('udid');
         var str=$("#fapiao").serialize();
		str += '&udid='+udid;

//		alert(addr);
//		alert(str);
		$.post("<?php echo U('home/order/ajaxPay');?>",str,function(res){
			if(res.valid){
                location.href="<?php echo U('home/userinfo/order');?>";
			}
		},'json');
	}
</script>
<!--中间结束-->
<!--尾部开始-->
<div class="mod-footer">
    <div class="foot-bannerw">
        <div class="foot-banner clearfix">
            <div class="banner-item">
                <a href="#" target="_blank" data-monitor="home_foot_days7"><i class="icon1">7</i>7天无理由退货</a>
            </div>
            <div class="banner-item">
                <a href="#" target="_blank" data-monitor="home_foot_days15"><i class="icon2">15</i>15天免费换货</a>
            </div>
            <div class="banner-item"><i class="icon3">包</i>满99元包邮</div>
            <div class="banner-item">
                <a href="#" target="_blank" data-monitor="home_foot_moblie"><i class="icon4">服</i>手机特色服务</a>
            </div>
        </div>
    </div>

    <div class="foot-containerw">
        <div class="foot-container clearfix">
            <dl class="foot-con">
                <dt data-monitor="home_foot_freshman">联系作者</dt>
                <dd data-monitor="home_help_freshman">
                    <a target="_blank" href="javascript:;" rel="nofollow">YD</a>
                </dd>
            </dl>
            <dl class="foot-con">
                <dt data-monitor="home_foot_help">作者电话</dt>
                <dd data-monitor="home_help_help">
                    <a target="_blank" href="#">13517224196</a>
                </dd>
            </dl>
            <dl class="foot-con">
                <dt data-monitor="home_foot_guide">联系邮箱</dt>
                <dd data-monitor="home_help_guide">
                    <a target="_blank" href="#" rel="nofollow">yedong_163_hubei.com</a>
                </dd>
            </dl>
            <style>

            </style>
            <dl class="foot-con">
                <dt data-monitor="home_foot_tuiguang">友情链接</dt>

                <?php if(is_array($links)): foreach($links as $key=>$vo): ?><dd data-monitor="home_help_try">
                        <a target="_blank" href="<?php echo ($vo['lurl']); ?>" rel="nofollow"><?php echo ($vo['lname']); ?></a>
                    </dd><?php endforeach; endif; ?>

            </dl>
            <dl class="foot-con">
                <dt data-monitor="home_foot_try">关注大米商城</dt>
                <dd data-monitor="home_help_try">
                    <a target="_blank" href="#" rel="nofollow">360商城大事记</a>
                </dd>
            </dl>

        </div>
    </div>
    <div class="footer-copyright"><?php echo V("sp_system.0")['svalue'];?> <?php echo V('sp_system.2')['svalue'];?>
        <?php echo V('sp_system.1')['svalue'];?>
    </div>
</div>
<!--尾部结束-->

<!--右边底部返回顶部-->
<div class="slidebar" id="slidebar">
    <ul>
        <li class="topback">
            <a href="javascript:;"></a>
        </li>
    </ul>
</div>
<!--右边底部返回顶部结束-->

</body>

</html>